/*
 * Created by SharpDevelop.
 * User: tjog
 * Date: 10/13/2009
 * Time: 11:48 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Xml;
using System.Xml.Xsl;
using System.IO;
using stdf;

namespace test {
	//
	// Encapsulate all the loadData functions in this class
	//
	public class DataFileReader {
		public DataFileReader() {
			
		}
		public static bool loadSTDF( string fileName, ref System.Data.DataTable data, ref System.Data.DataTable headerData) {
			bool success = false;
			stdf.StdfFile stdfFile = new stdf.StdfFile();
			success = stdfFile.open( fileName, stdf.RWMode.ReadOnly);
			if(success) {
				success = stdfFile.read( ref data, ref headerData);
			}
			return success;
		}
		public static bool loadCSV( string fileName, ref DataTable data) {
			bool success = false;
			
			return success;
		}
		public static bool loadTWDP( string fileName, ref DataTable data) {
			bool success = false;
			
			return success;
		}
		public static bool loadXLS( string fileName, ref DataTable data) {
			bool success = false;
			
			return success;
		}
	}

	public class DataFileWriter {
		public DataFileWriter() {
			
		}
	
	/*
		public static void CreateWorkbook(DataSet ds, String path)
		{
			XmlDataDocument xmlDataDoc = new XmlDataDocument(ds);
			XslTransform xt = new XslTransform();
			StreamReader reader =new StreamReader(typeof (WorkbookEngine).Assembly.GetManifestResourceStream(typeof (WorkbookEngine), "Excel.xsl"));
			XmlTextReader xRdr = new XmlTextReader(reader);
			xt.Load(xRdr, null, null);
	
			StringWriter sw = new StringWriter();
			xt.Transform(xmlDataDoc, null, sw, null);
	
			StreamWriter myWriter = new StreamWriter (path + "\\Report.xls");
			myWriter.Write (sw.ToString());
			myWriter.Close ();
		}
		*/
		
	}

}
